package com.tarena.charging.device.repository;

import com.tarena.charging.device.mapper.TestMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

@Repository
@Slf4j
public class TestRepository {
    //查询数据库的充电站个数 数据访问mysql
    @Autowired
    private TestMapper testMapper;
    public Long test() {
        //mybatis-plus的baseMapper的接口方法
        //QueryWrapper的参数 用来封装 一个sql语句中的where条件
        //select count(0) from charging_sttion
        Long total = testMapper.getTotal();
        log.info("查询到的总数是:{}",total);
        return testMapper.selectCount(null);
    }
}
